// Glassmorphism Design System
// Based on Ambient Glass Dashboard design specification

// Color Palette - Inspired by Smart Home Dashboard
:root {
  // Primary Background - Warm gradient tones
  --bg-primary: #8b9dc3;
  --bg-secondary: #a8b5d1;
  
  // Glass Component Backgrounds - Warmer glass effect
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-bg-dark: rgba(139, 157, 195, 0.2);
  --glass-border: rgba(255, 255, 255, 0.2);
  
  // Accent Colors - Warm brown/orange palette
  --accent-primary: #c4956c;
  --accent-secondary: #d4a574;
  --accent-orange: #e6b887;
  --accent-amber: #f4d1ae;
  --accent-blue: #7a9cc6;
  --accent-success: #8fbc8f;
  --accent-warning: #deb887;
  --accent-danger: #cd853f;
  
  // Text Colors - Softer contrast
  --text-primary: #2d3748;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --text-white: #ffffff;
  
  // Shadow and Depth
  --shadow-glass: 0 8px 32px rgba(31, 38, 135, 0.37);
  --shadow-hover: 0 12px 40px rgba(31, 38, 135, 0.5);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
  
  // Border Radius
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

// Glassmorphism Base Mixin
@mixin glass-effect($opacity: 0.25, $blur: 20px) {
  background: rgba(255, 255, 255, $opacity);
  backdrop-filter: blur($blur);
  -webkit-backdrop-filter: blur($blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
}

@mixin glass-dark($opacity: 0.1, $blur: 20px) {
  background: rgba(0, 0, 0, $opacity);
  backdrop-filter: blur($blur);
  -webkit-backdrop-filter: blur($blur);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-glass);
}

// Glass Card Component
.glass-card {
  @include glass-effect();
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  &:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
  }
  
  &.glass-card--sm {
    padding: 16px;
    border-radius: var(--radius-md);
  }
  
  &.glass-card--lg {
    padding: 32px;
    border-radius: var(--radius-xl);
  }
}

// Glass Navigation
.glass-nav {
  @include glass-effect(0.8);
  border-radius: 0;
  border-left: none;
  border-right: none;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

// Glass Sidebar
.glass-sidebar {
  @include glass-effect(0.9);
  border-radius: 0;
  border-top: none;
  border-bottom: none;
  border-left: none;
}

// Stat Card with Gradient
.stat-card-glass {
  @include glass-effect(0.15);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
      rgba(255, 255, 255, 0.1) 0%, 
      rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
  }
  
  &:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
  }
  
  // Gradient Variants
  &.stat-card-glass--primary {
    background: linear-gradient(135deg, 
      rgba(102, 126, 234, 0.8) 0%, 
      rgba(118, 75, 162, 0.8) 100%);
    color: var(--text-white);
  }
  
  &.stat-card-glass--warning {
    background: linear-gradient(135deg, 
      rgba(250, 173, 20, 0.8) 0%, 
      rgba(255, 122, 69, 0.8) 100%);
    color: var(--text-white);
  }
  
  &.stat-card-glass--success {
    background: linear-gradient(135deg, 
      rgba(79, 172, 254, 0.8) 0%, 
      rgba(0, 242, 254, 0.8) 100%);
    color: var(--text-white);
  }
  
  &.stat-card-glass--danger {
    background: linear-gradient(135deg, 
      rgba(255, 107, 107, 0.8) 0%, 
      rgba(238, 90, 36, 0.8) 100%);
    color: var(--text-white);
  }
}

// Interactive Elements
.glass-button {
  @include glass-effect(0.2);
  border-radius: var(--radius-md);
  padding: 12px 24px;
  border: none;
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  &:hover {
    @include glass-effect(0.3);
    transform: translateY(-1px);
  }
  
  &:active {
    transform: translateY(0);
  }
  
  &.glass-button--primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-orange));
    color: var(--text-white);
    
    &:hover {
      box-shadow: 0 8px 25px rgba(66, 165, 245, 0.4);
    }
  }
}

// Glass Toggle Switch
.glass-toggle {
  width: 60px;
  height: 30px;
  border-radius: 15px;
  @include glass-effect(0.3);
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  &::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--text-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  &.active {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-amber));
    
    &::after {
      transform: translateX(30px);
    }
  }
}

// Glass Input
.glass-input {
  @include glass-effect(0.1);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  &:focus {
    outline: none;
    @include glass-effect(0.2);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(66, 165, 245, 0.1);
  }
  
  &::placeholder {
    color: var(--text-muted);
  }
}

// Glass Table
.glass-table {
  @include glass-effect(0.05);
  border-radius: var(--radius-lg);
  overflow: hidden;
  
  .el-table {
    background: transparent;
    
    &::before {
      display: none;
    }
    
    th, td {
      background: transparent;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    th {
      background: rgba(255, 255, 255, 0.1);
      color: var(--text-primary);
      font-weight: 600;
    }
    
    tr:hover td {
      background: rgba(255, 255, 255, 0.05);
    }
  }
}

// Animation Utilities
@keyframes glass-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.glass-shimmer {
  position: relative;
  overflow: hidden;
  
  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent
    );
    animation: glass-shimmer 2s infinite;
  }
}

// Responsive Utilities
@media (max-width: 768px) {
  .glass-card {
    padding: 16px;
    border-radius: var(--radius-md);
  }
  
  .stat-card-glass {
    padding: 16px;
  }
}

// Utility Classes
.glass-bg {
  @include glass-effect();
}

.glass-bg-dark {
  @include glass-dark();
}

.text-glass {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.border-glass {
  border: 1px solid var(--glass-border);
}

.shadow-glass {
  box-shadow: var(--shadow-glass);
}

.shadow-glass-hover {
  box-shadow: var(--shadow-hover);
}
